<!DOCTYPE html>
<html class="ui-page-login">

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>首页-指标查询</title>
		<link href="css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="css/mui.picker.min.css">
		<link href="css/style.css" rel="stylesheet" />
		<link href="css/reg_style.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="css/ljq.css" />
		<link rel="stylesheet" type="text/css" href="css/ljq-post.css" />
		<link rel="stylesheet" type="text/css" href="css/hgs-date.css" />
		<style>
			.div4:last-child {
				border-bottom: 5px solid #eee!important;
			}
			.head1 em {
			    float: left;
			    width: 0.23rem;
			    height: 0.44rem;
			}
		</style>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav head1">
			<em class="mui-action-back">
				<img class="img1 mui-action-back" src="img/fanhui.png" alt="" />
			</em>
			<div class="div1"><span class="span0" id="list-shop-lists" onclick="user_select_shop();">指标查询</span></div>
			<img class="img2" src="img/problem.png" alt="" onclick="time_img(var_zhibiaochaxun);"/>
			<!---->

			<!---->
		</header>
		<div class="mui-content">
			<div class="zong">
				<div class="div4 clearfix">
					<span class="span4">指标查询</span>
					<em onclick='xtype();' id='index-type' class="em4">营业额</em>
				</div>
				<div class="div4 clearfix">
					<span class="span4">选择时间</span>
					<em onclick="btn_date_show();" id='index-date-show' class="em4 em4_time">2017-02-05</em>
				</div>
				<div class="div4 clearfix">
					<span class="span4">时间维度</span>
					<em onclick="xunit();" id='index-unit' class="em4">小时</em>
				</div>
			</div>

			<!--<div class="tu_graphic clearfix">
				<div id='index-graphic-data1-name' class="title1"></div>
				<div id="statistics_turnover1" class="main_graphic"></div>
			</div>-->

			<div id="mychart" class="chart" style="width: 100%; height: 2.5rem; border: 0px solid #333;margin-top: 0.25rem;"></div>

		</div>

		<!--/********************日期控件**************************/-->
		<!--<link rel="stylesheet" type="text/css" href="css/hgs-date.css" />
		<script src="js/hgs-date.js"></script>-->
		<!--/********************日期控件**************************/-->
		<input id="index-shop-lists-id" type="hidden">
		<input id="index-shop-lists" type="hidden">
		<input id='index-end-date' type="hidden" />
		<input id='index-start-date' type="hidden" />

		<!--/***************************************************/-->

		<script src="js/mui.min.js"></script>
		<script src="js/mui.enterfocus.js"></script>
		<script src="js/app.js"></script>
		<script src="js/mui.picker.min.js"></script>
		<!--<script type="text/javascript" src="js/jsencrypt.min.js"></script>
		<script src="js/md5.js"></script>-->
		<script src="js/crypto-js.js"></script>
		<script src="js/jquery.js"></script>
		<script type="text/javascript" src="js/common.js?ver=20170122"></script>
		<script type="text/javascript" src="js/fuction.js?ver=20170122"></script>
	<script src="js/echarts.min-3.8.4.js"></script>
		<script src="js/hgs-date.js"></script>
		<script src="js/chart-zx-only-bj.js?ver=20170122"></script><!--//只有折线与背景图	-->
		<script src="js/ljq_biaoqiao.js"></script>		<!--//标签	-->	
		
		<script type="text/javascript">
			mui.init();
		</script>

		<script>
			//初始化指标说明
			var var_zhibiaochaxun=zhibiaochaxun;
			var xtype_picker = new mui.PopPicker();
			var xunit_picker = new mui.PopPicker();
			//picker初始化内容 
			var xtype_position_json = [{
				value: 1,
				text: '营业额'
			}, {
				value: 2,
				text: '客流量'
			}, {
				value: 3,
				text: '客单价'
			}, {
				value: 4,
				text: '成交率'
			}, {
				value: 5,
				text: '成交笔数'
			}, 
//			{
//				value: 6,
//				text: '连带率'
//			}, {
//				value: 7,
//				text: '件单价'
//			}
			];

			//增加日期与时间维度的联动
			var xunit_position_json1 = [{
				value: 1,
				text: '小时'
			}];

			//增加日期与时间维度的联动
			var xunit_position_json3 = [{
				value: 2,
				text: '天'
			}, {
				value: 3,
				text: '周'
			}, {
				value: 4,
				text: '月'
			}];

			//判断指标说明的变动
			function tel_zhibiaochaxun(var_tel){
				
				if(var_tel=='营业额'){
					var_zhibiaochaxun=index_yinyee;
				};
				
				if(var_tel=='客流量'){
					var_zhibiaochaxun=index_keliuliang;
				};
				
				if(var_tel=='成交率'){
					var_zhibiaochaxun=index_chengjiaolv;
				};
				
				if(var_tel=='客单价'){
					var_zhibiaochaxun=kedanjia;
				};	
				
				if(var_tel=='连带率'){
					var_zhibiaochaxun=liandailv;
				};
				
				if(var_tel=='销售件数'){
					var_zhibiaochaxun=xiaoshoujianshu;
				};
				
				if(var_tel=='成交笔数'){
					var_zhibiaochaxun=chengjiaobishu;
				};
				
				if(var_tel=='件单价'){
					var_zhibiaochaxun=jiandanjia;
				};			
		
			}

			mui.ready(function() {
				var xbxtype = decodeURI(getUrlParam('xbxtype'));
				mui("#index-type")[0].innerHTML = xbxtype;
				//判断指标说明的变动
				tel_zhibiaochaxun(xbxtype);

				//获取当前的客户数据
				xminereadyload();

				//获取当天的日期	
				var xtoday = GetDateStr(0);
				mui("#index-date-show")[0].innerHTML = xtoday;
				mui("#index-start-date")[0].value = xtoday;
				mui("#index-end-date")[0].value = xtoday;
				user_info.look_start_date = xtoday;
				user_info.look_end_date = xtoday;

				//这是初始化指标
				xtype_picker.setData(xtype_position_json);
				//这是初始化时间维度
				xunit_picker.setData(xunit_position_json1);

				//获取-指标查询数据信息
				statistics_quota();
			});

			//指标问题
			function xtype() {
				xtype_picker.show(function(SelectedItem) {
					mui("#index-type")[0].innerHTML = SelectedItem[0].text;
					//判断指标说明的变动
					tel_zhibiaochaxun(SelectedItem[0].text);

					//获取首页信息-数据
					statistics_quota();
				})
			}

			//指标问题
			function xunit() {
				xunit_picker.show(function(SelectedItem) {
					mui("#index-unit")[0].innerHTML = SelectedItem[0].text;
					//获取首页信息-数据
					statistics_quota();
				})
			}

			//获取首页信息-指标查询
			function statistics_quota() {
				var xbx = {}; //登录后的参数对象AES加密
				xbx.shop_id = user_info.look_shop_id; //是 店铺ID
				xbx.start_date = user_info.look_start_date; //开始搜索日期
				xbx.end_date = user_info.look_end_date; //结束搜索日期

				xbx.type = mui("#index-type")[0].innerHTML; //是 营业额、 客流量、 客单价、 成交率、 成交笔数、 连带率, 件单价
				xbx.unit = mui("#index-unit")[0].innerHTML; //是 单位: 小时, 天, 周, 月

				official_login_after(url_host + 'statistics/quota', xbx, 'statistics_quota');
			}

			/********************日期控件**************************/
			//打开日历界面
			function btn_date_show() {
				$("#date_mbanner").show();
			}

			//确定选择日期
			function btn_date_submit() {
				judge_date_input();

				//判断几个日期参数
				if(hgs_xdaynum == 2) {
					xunit_picker.setData(xunit_position_json3);
				} else {
					xunit_picker.setData(xunit_position_json1);
				}
				mui("#index-unit")[0].innerHTML = xunit_picker.getSelectedItems()[0].text;
				//获取首页信息-订单数据流水
				statistics_quota();
			}
			/********************日期控件**************************/


		</script>

	</body>

</html>